package com.cloud.cmt.cmtsso.service.impl;

import com.cloud.cmt.cmtsso.base.BaseServiceImpl;
import com.cloud.cmt.cmtsso.base.MyMapper;
import com.cloud.cmt.cmtsso.entity.UserInfo;
import com.cloud.cmt.cmtsso.mapper.UserMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * User: wcy
 * Date: 2017/9/5
 * Time: 17:36
 */
@Service("userService")
public class UserServiceImpl extends BaseServiceImpl {

    @Autowired
    UserMapper userMapper;

    public boolean addUser(UserInfo user) {
        int reuslt = userMapper.insert(user);
        if (reuslt>0)
            return true;
        return	false;
    }

    public UserInfo findByName(String userName) {
        return userMapper.findByUsername(userName);
    }

    @Override
    public MyMapper<UserInfo> getMapper() {
        return userMapper;
    }
}